package cn.com.yang.egg;

/**
 * 懒汉单例（静态内部类）
 * @Author 杨亿金
 * @Date 2022/2/5 22:16
 * @CopyRight
 * @Version
 */
public class StaticInnerSingleton {
    private StaticInnerSingleton(){}
    private static class InnerClass{
        private static StaticInnerSingleton singleton = new StaticInnerSingleton();
    }
    public static StaticInnerSingleton newInstance(){
        return InnerClass.singleton;
    }
}
